package com.taobao.top
{
	public class temp
	{
		public function temp()
		{
		}
private function temp():void
		{
			var reqArr:Array = new Array();
			reqArr.push((new TopRequestParam("app_key","12001962")),
				(new TopRequestParam("format","json")),
				(new TopRequestParam("method","taobao.sns.user.get")),
				(new TopRequestParam("uid","175754355")),
				(new TopRequestParam("session","156ed0716a4218506daddf30b9d344fe61")),
				(new TopRequestParam("timestamp","2009-07-08 22:14:20")),
				(new TopRequestParam("v","1.0"))
			);

			reqArr.sortOn("Key",Array.CASEINSENSITIVE);
			var str:String = "70a7744eb8c67d95a4201bbc6dd245b0";
			for each(var reqVO:TopRequestParam in reqArr)
			{
				trace(reqVO.Key,reqVO.Value);
				str+=reqVO.Key;
				str+=reqVO.Value;
			}
			trace(str);
			trace("Sign",MD5.hash(encodeURI(str)).toUpperCase());
			var result:String = MD5.hash(encodeURI(str)).toUpperCase();
			var url:String = "";
			for each(var reqVO2:TopRequestParam in reqArr)
			{
				url += reqVO2.Key+"="+reqVO2.Value+"&";
				
			}
			url+="sign=";
			url+=result;
			trace(url);
			var urlLdr:URLLoader = new URLLoader();
			var urlReq:URLRequest = new URLRequest("http://gw.sandbox.taobao.com/router/rest");
			urlReq.method= "post";
			urlReq.data = url;
			urlLdr.addEventListener(Event.COMPLETE,function(event:Event):void
			{
				trace(event.target.data);
				txtResult.text = event.target.data;
			});
			urlLdr.load(urlReq);
		}
	}
}